﻿<BaseControl:DialogControl x:Class="jSLCore.Client.Presentation.Authorization.Managment.RoleDetail"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:BaseControl="clr-namespace:jSLCore.Client.Presentation.BaseControl" xmlns:tk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" xmlns:j="clr-namespace:jSLCore.Client.Presentation.Controls" xmlns:Managment="clr-namespace:jSLCore.Client.Presentation.Authorization.Managment" xmlns:jBinding="clr-namespace:jSLCore.Client.Presentation.jBinding" xmlns:BaseValidationRules="clr-namespace:jSLCore.Client.Presentation.jBinding.BaseValidationRules" xmlns:Selection="clr-namespace:jSLCore.Client.Presentation.BaseControl.Selection" xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" Icon="../../../Resources/User.png" Title="Роль" MaxWidth="1024">
    <tk:DockPanel LastChildFill="True">
        <j:ImageGroupBox Header="Все разрешения(+ наследуемые)" tk:DockPanel.Dock="Left" Width="300">
            <Managment:PermissionGrid IsReadOnly="True" x:Name="allPermGrid"/>            
        </j:ImageGroupBox>
        <j:ImageGroupBox tk:DockPanel.Dock="Right" Width="300">
        	<j:ImageGroupBox.Header>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Собственные разрешения" Margin="0"/>
                    <Button Margin="5,0,0,0" Content="Добавить" Click="addPermission_Clicked"/>
                </StackPanel>
            </j:ImageGroupBox.Header>
        	<Managment:PermissionGrid IsReadOnly="True" x:Name="curPermGrid">
                <Managment:PermissionGrid.Columns>
                    <Selection:DataGridImageButtonColumn ButtonImage="../../../Resources/delete.png" Click="deletePermission_Clicked"/>                    
                </Managment:PermissionGrid.Columns>
            </Managment:PermissionGrid>
        </j:ImageGroupBox>
        <ScrollViewer>
            <StackPanel Orientation="Vertical">
                <j:ImageGroupBox Header="Детализация">
                    <StackPanel Orientation="Vertical">
                        <j:LeftHeaderContainer Header="Название:">
                            <TextBox Name="txt">
                                <BaseControl:BaseControl.jBinding>
                                    <jBinding:jValidationBinding Path="Name">                                        
                                        <BaseValidationRules:jNotEmptyStringRule/>
                                    </jBinding:jValidationBinding>
                                </BaseControl:BaseControl.jBinding>
                            </TextBox>
                        </j:LeftHeaderContainer>                                               
                    </StackPanel>
                </j:ImageGroupBox>
                <j:ImageGroupBox>
                    <j:ImageGroupBox.Header>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Базовые роли" Margin="0"/>
                            <Button Margin="5,0,0,0" Content="Добавить" Click="addRole_Clicked"/>
                        </StackPanel>
                    </j:ImageGroupBox.Header>
                    <Selection:jSLGrid x:Name="roleGrid" IsShowDetailsButtonVisible="True" ShowDetailsClicked="gotoRole_Clicked">    
                        <Selection:jSLGrid.Columns>
                            <Selection:DataGridImageButtonColumn ButtonImage="../../../Resources/delete.png" Click="deleteRole_Clicked"/>                            
                            <Controls:DataGridTextColumn Header="Название" Binding="{Binding Name}"/>
                        </Selection:jSLGrid.Columns>
                    </Selection:jSLGrid>
                </j:ImageGroupBox>
            </StackPanel>
        </ScrollViewer>
    </tk:DockPanel>
</BaseControl:DialogControl>
